module ActionView
  module Helpers
    module FormHelper
      if not method_defined?(:old_form_for)
        alias_method :old_form_for,:form_for
        def form_for(name,*args,&block)
          options = args.last.is_a?(Hash) ? args.pop : {}
          options = options.merge({:builder => Cool::TabularFormBuilder})
          args = (args << options)
          self.concat("<TABLE class='form_for_table'>",block.binding)
          old_form_for(name,*args,&block)
          self.concat("</TABLE>",block.binding)
        end      
      end
    end
  end
end